C:\Users\cubes>cd C:\xampp\mysql\bin

C:\xampp\mysql\bin>mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.5.25a MySQL Community Server (GPL)

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SHOW DATABASES;
+--------------------+
| Database           |
+--------------------+
| information_schema |
+--------------------+
1 rows in set (0.13 sec)

mysql> CREATE DATABASE `mb120`;
Query OK, 1 row affected (0.00 sec)

mysql> USE `mb120`;
Database changed
mysql> CREATE TABLE `countries`(
    -> `id` INT AUTO_INCREMENT PRIMARY KEY,
    -> `name` VARCHAR(80)
    -> );
Query OK, 0 rows affected (0.26 sec)

mysql> SHOW TABLES;
+-----------------+
| Tables_in_mb120 |
+-----------------+
| countries       |
+-----------------+
1 row in set (0.00 sec)

mysql> DESCRIBE `countries`;
+-------+-------------+------+-----+---------+----------------+
| Field | Type        | Null | Key | Default | Extra          |
+-------+-------------+------+-----+---------+----------------+
| id    | int(11)     | NO   | PRI | NULL    | auto_increment |
| name  | varchar(80) | YES  |     | NULL    |                |
+-------+-------------+------+-----+---------+----------------+
2 rows in set (0.08 sec)

mysql> DESC `countries`;
+-------+-------------+------+-----+---------+----------------+
| Field | Type        | Null | Key | Default | Extra          |
+-------+-------------+------+-----+---------+----------------+
| id    | int(11)     | NO   | PRI | NULL    | auto_increment |
| name  | varchar(80) | YES  |     | NULL    |                |
+-------+-------------+------+-----+---------+----------------+
2 rows in set (0.03 sec)

mysql> SELECT NOW();
+---------------------+
| NOW()               |
+---------------------+
| 2013-04-21 09:29:37 |
+---------------------+
1 row in set (0.08 sec)

mysql> SELECT CURDATE();
+------------+
| CURDATE()  |
+------------+
| 2013-04-21 |
+------------+
1 row in set (0.00 sec)

mysql> SELECT CURTIME();
+-----------+
| CURTIME() |
+-----------+
| 09:30:46  |
+-----------+
1 row in set (0.00 sec)

mysql> SELECT * FROM `countries`;
Empty set (0.00 sec)

mysql> INSERT INTO `countries` VALUES(null,'india');
Query OK, 1 row affected (0.07 sec)

mysql> INSERT INTO `countries` VALUES(null,'pakistan');
Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO `countries`(`name`) VALUES('Nepal');
Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO `countries`(`name`) VALUES('Srilanka');
Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO `countries` SET `name`='Bangladesh';
Query OK, 1 row affected (0.01 sec)

mysql> SELECT * FROM `countries`;
+----+------------+
| id | name       |
+----+------------+
|  1 | india      |
|  2 | pakistan   |
|  3 | Nepal      |
|  4 | Srilanka   |
|  5 | Bangladesh |
+----+------------+
5 rows in set (0.00 sec)

mysql> UPDATE `countries` SET `name`='Sri Lanka' WHERE `id`=4;
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> SELECT * FROM `countries`;
+----+------------+
| id | name       |
+----+------------+
|  1 | india      |
|  2 | pakistan   |
|  3 | Nepal      |
|  4 | Sri Lanka  |
|  5 | Bangladesh |
+----+------------+
5 rows in set (0.00 sec)

mysql> DELETE FROM `countries` WHERE `id`=5;
Query OK, 1 row affected (0.07 sec)

mysql> SELECT * FROM `countries`;
+----+-----------+
| id | name      |
+----+-----------+
|  1 | india     |
|  2 | pakistan  |
|  3 | Nepal     |
|  4 | Sri Lanka |
+----+-----------+
4 rows in set (0.00 sec)

mysql>
